<?php 
$fb_user = FB::getUser();
?>
<h1>Login</h1>
<?php echo  $this->Form->create('User', array('type' => 'post', 'class' => 'form-horizontal')); ?>
<?php 
	echo $this->Form->input('username');
	echo $this->Form->input('password');
?>
<?php echo $this->Form->end(); ?>
<?php
echo $this->Auth->user('id');
echo '<br/>';
if(!$this->Auth->user('id'))
{
	echo $this->Html->link("Register", array('controller' => 'users','action'=> 'register'));
	echo '<br/>';

	echo $this->Html->link('Facebook Login',array('controller'=>'users', 'action'=>'facebook_login'));
	//echo $this->Html->link('Logout', FB::getLogoutUrl());
}
else {
	echo $this->Html->link('Logout', array('controller' => 'users', 'action' => 'logout'));
}
?>
